//
//  LYTextField.m
//  day02
//
//  Created by dllo on 16/6/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "LYTextField.h"

@interface LYTextField() <UITextFieldDelegate>//签订协议

@end

@implementation LYTextField

-(instancetype)initWithFrame:(CGRect)frame withPlaceholder:(NSString *)placeholder
{
    self = [super initWithFrame:frame];
    if (self) {
        self.placeholder = placeholder;
        self.borderStyle = UITextBorderStyleRoundedRect;
        self.clearButtonMode = UITextFieldViewModeAlways;
    }
    self.delegate = self;
    
    return self;
}

//实现协议的方法
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [self resignFirstResponder];
    return YES;
}

@end
